﻿using System;
using System.IO;

namespace Moonlite.Languages.Andromeda.Implementation
{
    internal abstract class AbstractAndromedaParserFactory : IAndromedaParserFactory
    {
        public abstract IAndromedaParser CreateParserAndParse(Stream stream);
        public IAndromedaParser CreateParserAndParse(string filename)
        {
            using (FileStream stream = new FileStream(filename, FileMode.Open))
            {
                return CreateParserAndParse(stream);
            }
        }
    }
}
